import React, { Suspense } from 'react';
import "./App.css"
import { useRoutes } from "react-router-dom"
import routes from './router/routes';
import { Link } from 'react-router-dom';
///引入自己定义的守卫hook
import useRouteWithGuard from "./hooks/useRouteWithGuard"
import LayoutBase from './Layout';
function App() {
  let element = useRouteWithGuard({ routes, tokenKey: 'qf-token' })

  return (
    <div className='app'>
      <LayoutBase>
        <Suspense fallback={<h1>正在加载</h1>}>
          {element}
        </Suspense>
      </LayoutBase>
    </div>
  );
}

export default App;
